<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  <title>Organizer</title>

  <link rel="icon" type="image/png" href="/images/erp_app/favicon.ico">

  <!-- include google maps -->
  <script src="https://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
  <!-- include google maps -->

  <!--javascript-->
  <%= include_extjs(:debug => (Rails.env == 'development' or Rails.env == 'shared_dev')) %>

  <%= javascript_include_tag("erp_app/utility.js") %>

  <!-- shared application resources -->
  <%= load_shared_application_resources(:javascripts) %>
  <!-- end shared application resources -->

  <%= javascript_include_tag("erp_app/organizer/app.js") %>

  <%= setup_js_authentication(@user) %>

  <!-- application resources -->
  <% @user.get_application_resource_paths(:organizer, :js).each do |path| %>
    <%= javascript_include_tag(path) %>
  <% end %>

  <% @user.get_application_resource_paths(:organizer, :css).each do |path| %>
    <%= stylesheet_link_tag(path) %>
  <% end %>
  <!-- end application resources -->

  <%= set_max_file_upload %>

  <!-- load base css file -->
  <%= stylesheet_link_tag('erp_app/organizer/base.css') %>
  <!-- end load base css file -->

  <!-- application resources -->
  <%= load_shared_application_resources(:stylesheets) %>

  <!-- end application resources -->

  <%= include_compass_ae_instance %>
</head>
<body scroll="no">
<script type="text/javascript">
  Ext.onReady(function () {
    Ext.QuickTips.init();

    var organizerLayout = Ext.create("Compass.ErpApp.Organizer.Layout", {logout_url: '/session/sign_out'});

    <% @user.apps.each do |application| %>

    var <%=application.internal_identifier.camelize%> =Ext.create("Compass.ErpApp.Organizer.Applications.<%= raw application.internal_identifier.camelize%>.Base", {organizerLayout: organizerLayout});<%=application.internal_identifier.camelize%>.setup();

    <%end%>
    organizerLayout.setupLogoutButton();
    organizerLayout.setup();

    Compass.ErpApp.Utility.preventBrowserBack();
    Compass.ErpApp.Utility.setupErpAppLogoutRedirect();
  });
</script>
<%= setSessionTimeout %>
</body>
</html>

